﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using ERPStore.Extensions;

namespace ERPStore.Web.Start
{
	public class BundleConfig
	{
		public static void Register(System.Web.HttpContextBase ctx)
		{
			if (ERPStore.GlobalConfiguration.Configuration.HosterName == "WebApp"
				|| ERPStore.GlobalConfiguration.Configuration.HosterName == "WebApi")
			{
				var optimizationService = GlobalConfiguration.Configuration.DependencyResolver.GetService<Services.IOptimizationService>();
				optimizationService.RegisterBundles(ctx);

				GlobalConfiguration.Configuration.Logger.Info("bundles configured");
			}
		}
	}
}
